//
//  FirstCrameCollectionViewCell.m
//  旅游咨询
//
//  Created by 高建 on 15/4/23.
//  Copyright (c) 2015年 xubin. All rights reserved.
//

#import "FirstCrameCollectionViewCell.h"

@implementation FirstCrameCollectionViewCell
-(void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes
{
    
    
    UIImageView *imageV = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, WidthZ, HeighZ)];
    imageV.backgroundColor = [UIColor blackColor];
    [self.contentView addSubview:imageV];
    
    
   
    
    self.FirstCrameImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, WidthZ * 0.9733, self.contentView.frame.size.height)];
    self.FirstCrameImageView.backgroundColor = [UIColor grayColor];
    [imageV addSubview:self.FirstCrameImageView];
    [_FirstCrameImageView release];
    
    
}



-(void)setMyFirstCrame:(photoModel *)myFirstCrame
{
    if (_myFirstCrame != myFirstCrame) {
        [_myFirstCrame release];
        _myFirstCrame = [myFirstCrame retain];
    }
    
    NSURL *url = [NSURL URLWithString:myFirstCrame.photo];
    
    [self.FirstCrameImageView sd_setImageWithURL:url];
    
    CGRect frame = self.FirstCrameImageView.frame;
    frame.size.height = [[myFirstCrame.photo_info objectForKey:@"h"] floatValue] / ([[myFirstCrame.photo_info objectForKey:@"w"] floatValue] / (WidthZ * 0.9733));
    self.FirstCrameImageView.frame = frame;
    
    self.FirstCrameImageView.center = CGPointMake(WidthZ / 2, HeighZ / 2);
    
}




@end
